<template>
	<el-select v-model="checkedRole" :multiple="multiple" v-bind="$attrs">
		<el-option v-for="(item, index) in list" :key="index" :label="item.name" :value="item.id"></el-option>
	</el-select>
</template>

<script>
export default {
	props: {
		value: { type: [String, Array] },
		list: { type: Array, default: () => [] },
		multiple: { type: Boolean, default: false }
	},
	data() {
		return {
			checkedRole: this.value
		};
	},
	watch: {
		value(data) {
			this.checkedRole = data;
		},
		checkedRole(data) {
			this.$emit('input', data);
		}
	}
};
</script>

<style scoped></style>
